﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wucThemToaThuoc.ascx.cs" Inherits="HeathCareSystem.wuc.wucThemToaThuoc" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<style type="text/css">
    .style1
    {
        width: 94%;
    }
    .style3
    {
        text-align: center;
        width: 124px;
    }
    .style4
    {
        height: 30px;
    }
</style>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <table align="center" class="style1">
    <tr>
        <td colspan="2" 
            
            style="text-align: center; font-size: x-large; font-weight: bold; color: #FF0000;" 
            class="style4">
            Toa Thuốc</td>
    </tr>
    <tr>
        <td class="style3">
            Mã Bệnh Nhân:</td>
        <td>
            <asp:TextBox ID="txtMa" runat="server" Height="24px" Width="150px" 
                Enabled="False" ReadOnly="True"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label1" runat="server" Text="Ngày Lập:"></asp:Label>
            &nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="TextBox1" runat="server" Width="150px" Height="24px" 
                Enabled="False" ForeColor="#3399FF" ReadOnly="True"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Tên Thuốc:</td>
        <td>
            <asp:TextBox ID="txtTen" runat="server" Height="24px" Width="224px"></asp:TextBox>
            <asp:AutoCompleteExtender ID="txtTen_AutoCompleteExtender" runat="server" 
                TargetControlID="txtTen"
                UseContextKey="True" BehaviorID="AutoCompleteEx" ServicePath="~/Tier/AutoComplete.asmx"
                ServiceMethod="GetListTenThuoc" MinimumPrefixLength="2" CompletionInterval="1000"
                EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true">
                <animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".4">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".4">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </animations>
            </asp:AutoCompleteExtender>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Số Lượng:</td>
        <td>
            <asp:TextBox ID="txtSoLuong" runat="server" Height="20px" Width="223px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Chỉ Định:</td>
        <td>
&nbsp; Dùng :
            <asp:TextBox ID="txtDung" runat="server"></asp:TextBox>
&nbsp;
            <asp:Label ID="lblNgày" runat="server" Text="Trong Ngày"></asp:Label>
&nbsp;&nbsp;&nbsp; Lần:&nbsp;&nbsp;
            <asp:TextBox ID="txtLan" runat="server"></asp:TextBox>
            <asp:Label ID="lblDonVi" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Chỉ Định Thêm:</td>
        <td>
            <asp:RadioButton ID="rbtnTruocAn" runat="server" Text="Trước Khi Ăn" 
                GroupName="chidinhthem" />
            <asp:RadioButton ID="rbtnSauAn" runat="server" Text="Sau Khi Ăn " 
                GroupName="chidinhthem" />
        </td>
    </tr>
    <tr>
        <td colspan="2">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnThemDS" runat="server" Height="25px" Text="Thêm Thuốc" 
                Width="137px" onclick="btnThemDS_Click" />
            <br />
            <br />
            <table class="style1" style="border-style: solid">
                <tr>
                    <td style="font-size: large; font-weight: bolder; color: #0000FF">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Danh Sách Thuốc<br />
                        <asp:GridView ID="gvDanhSach" runat="server" Width="507px" 
                            AutoGenerateColumns="False" EnableModelValidation="True" 
                            onrowdeleting="gvDanhSach_RowDeleting">
                            <Columns>
                                <asp:BoundField DataField="MaChiTietDonThuoc" HeaderText="Ma Chi Tiet">
                                <ControlStyle Height="0px" Width="0px" />
                                <FooterStyle Width="0px" />
                                <HeaderStyle Height="0px" Width="0px" Wrap="False" />
                                <ItemStyle Height="0px" Width="0px" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TenThuoc" HeaderText="Ten Thuoc" />
                                <asp:BoundField DataField="SoLuong" HeaderText="So Luong" />
                                <asp:BoundField DataField="ChiDinh1" HeaderText="Chi Dinh 1" />
                                <asp:BoundField DataField="ChiDinh2" HeaderText="Chi Dinh 2" />
                                <asp:BoundField DataField="ChiDinhThem" HeaderText="Chi Dinh Them" />
                                <asp:CommandField HeaderText="Xoa" ShowDeleteButton="True" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
        </td>
    </tr>
</table>

    </ContentTemplate>
</asp:UpdatePanel>
